package top.jfunc.network.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import top.jfunc.common.http.smart.SmartHttpClient;

/**
 * @author xiongshiyan at 2019/5/7 , contact me with email yanshixiong@126.com or phone 15208384257
 */
@RestController
@RequestMapping("/get")
public class GetController extends BaseController {
    @Autowired
    private SmartHttpClient smartHttpClient;

    @GetMapping("httpclient")
    public String httpclient() throws Exception{
        return smartHttpClient.get("get/query");
    }
    @GetMapping("ex/local")
    public String exLocal() throws Exception{
        throw new RuntimeException("客户端异常测试");
    }
    @GetMapping("ex/other")
    public String exOther() throws Exception{
        return smartHttpClient.get("get/ex");
    }
}
